package com.clock.web.controller.user;

import com.clock.common.core.controller.BaseController;
import com.clock.shop.service.IUserSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/search")
public class UserSearchController extends BaseController {

      @Autowired
      private IUserSearchService userSearchService;

      @GetMapping("/searchList")
      public ResponseEntity<Map<String, List<?>>> search(@RequestParam("keyword") String keyword) {
            Map<String, List<?>> results = userSearchService.search(keyword);
            return ResponseEntity.ok(results);
      }
}
